import HttpRequest from '@/api/request';
import ApiConfig from '@/api/api-config';

function getRoleList(option) {//角色列表
    let url = ApiConfig.getRoleList;
    return HttpRequest.requestJsonPost(url,option)
}
function getRoleCategoryList(option) {//获取角色类型
    let url = ApiConfig.getRoleCategoryList;
    return HttpRequest.requestJsonPost(url,option)
}
function getRoleFunction(option) {//获取角色功能权限
    let url = ApiConfig.getRoleFunction;
    return HttpRequest.requestJsonPost(url,option)
}

function getPageList(option) {//获取菜单页面权限
    let url = ApiConfig.getPageList;
    return HttpRequest.requestJsonPost(url,option)
}

function updateRoleFunction(option) {//修改
    let url = ApiConfig.updateRoleFunction;
    return HttpRequest.requestJsonPost(url,option)
}

function saveOrUpdateRole(option) {//修改
    let url = ApiConfig.saveOrUpdateRole;
    return HttpRequest.requestJsonPost(url,option)
}

function getDictListByDictId(option) {
    let url = ApiConfig.getDictListByDictId;
    return HttpRequest.requestJsonPost(url,option)
}

function del(option) {
    let url = ApiConfig.del;
    return HttpRequest.requestJsonPost(url,option)
}
function roleScopeCandidates(option) {
    let url = ApiConfig.roleScopeCandidates;
    return HttpRequest.requestJsonPost(url,option)
}
// 根据角色Id查询对应的影院ID
function finAll (option) {
    let url = ApiConfig.finAll;
    return HttpRequest.requestJsonPost(url,option)
}
// 数据权限页面的电影列表的查询
function byHeadquartersCode (option) {
    let url = ApiConfig.byHeadquartersCode+'?allFlag=' + option;
    return HttpRequest.requestFormPost(url)
}
// // 字典表根据类型查询
function byType() {
    let url = ApiConfig.byType+'?codeType=roleType';
    return HttpRequest.requestFormPost(url)
}
function cinemaUpdate(option) {
    let url = ApiConfig.cinemaUpdate;
    return HttpRequest.requestFormPost(url,option)
}
function bindCinemaList(params) {
    let url = ApiConfig.bindCinemaList;
    return HttpRequest.requestJsonPost(url,params)
}
let Service = {
    getRoleList,//角色列表
    getRoleFunction,//获取角色功能权限
    getPageList,//获取菜单页面权限
    updateRoleFunction,
    saveOrUpdateRole,
    getDictListByDictId,
    del,
    getRoleCategoryList,// 获取角色类型
    roleScopeCandidates,//获取页面查看范围
    finAll,//根据角色Id查询对应的影院ID
    byType, //字典表根据类型查询
    byHeadquartersCode, //数据权限页面的电影列表的查询
    cinemaUpdate,
    bindCinemaList,
};

export default Service;